//
//  ViewController.m
//  TestAutoresizing
//
//  Created by apple on 2017/5/17.
//  Copyright © 2017年 itheima. All rights reserved.
//

#import "ViewController.h"

@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
    
    UIView *codeView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 300, 600)];
    codeView.backgroundColor = [UIColor greenColor];
//    [self.view addSubview:codeView];
//    NSLog(@"%zd", codeView.autoresizingMask);
    //右下间距固定,宽高固定
    codeView.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleTopMargin;
    //父视图可以设置取消对所有子视图的autoresizing影响
//    self.view.autoresizesSubviews = NO;
    
    UIView *xibView = [[NSBundle mainBundle] loadNibNamed:@"TestXib" owner:nil options:nil]. lastObject;
    [self.view addSubview:xibView];
}




@end
